<!-- FILE:templates/apps/delete.html -->
<!--Body content-->
<div id="content" class="clearfix">
    <div class="contentwrapper"><!--Content wrapper-->
    {% set app_page_title="Delete an Application" %}
        {% if standalone_app_page %}
            <div class="page-header">
                <h1>{{ app_page_title }}</h1>
            </div><!--close header-->
        {% endif %}
    {% set apps=apps_user_owns %}
        <!-- Build page from here: -->
        <div class="row-fluid">
          <div class="well">
          {% if flash_message %}
            <ul id="noticeExplanation"><li class="flash notice">{{ flash_message }}</li></ul>
          {% endif %}
          {% if apps|length > 0 %}
               <form action="/apps/delete" method="post"><div style="margin:0;padding:0;display:inline">
              <p>
                <select id="appname" name="appname">
                {% for app in apps|sort  %}
                    <option value="{{ app }}">{{ app }}</option>
                {% endfor %}
                </select>
              </p>
              <p>
                <input class="btn btn-danger" name="commit" onclick="if (!confirm('Are you sure you want to delete this app?')) return false; return true;" type="submit" value="Delete" />
              </p>
              </form>
          {% else %}
            <br />
            {% if is_user_cloud_admin %}
              <h2> There are no applications running.<br />
            {% else %}
              <h2> There are no running applications that you have permission to delete.<br />
            {% endif %}
              Want to&nbsp;<a href="/apps/new">upload an app</a>?
            </h2>
          {% endif %}
        </div><!--close well-->
        </div> <!-- end row fluid -->
    </div> <!-- end content wrapper -->
</div> <!--end content-->


